@import '../../style/default.scss';
/* button */
$disabled-border: 1px solid #d9d9d9;
$disabled-bg: #f5f5f5;
/* =========================圆角========================= */
/* 表单圆角 */
$form-radius: 3px;

/* 公共按钮样式 */
[mat-flat-button].mat-flat-button,
[mat-stroked-button].mat-stroked-button,
[mat-button].mat-button,
[mat-icon-button].mat-icon-button {
  height: 32px;
  line-height: 30px;
  &[size='mini'] {
    height: 24px;
    line-height: 22px;
  }
  .mat-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .mat-button-focus-overlay,
  &:hover .mat-button-focus-overlay {
    background: transparent;
    opacity: 0;
  }

  &[disabled].mat-button-disabled {
    cursor: no-drop;
    background: $disabled-bg;
    text-shadow: none;
  }

  .icon-before {
    margin-right: 5px;
  }

  .icon-after {
    margin-left: 5px;
  }
}

/* 文字按钮样式 */
[mat-flat-button].mat-flat-button,
[mat-stroked-button].mat-stroked-button,
[mat-button].mat-button {
  min-width: 64px;
  border-radius: $form-radius;
  font-size: 12px;
  box-sizing: border-box;
  border: 1px solid transparent;
  padding: 0 12px;
  &[size='mini'] {
    font-size: 12px;
    min-width: 56px;
    padding: 0 8px;
  }
  &[disabled].mat-button-disabled {
    border: $disabled-border;
  }
}

/* 实心按钮样式 */
[mat-flat-button].mat-flat-button:not([disabled]),
[mat-flat-button].mat-flat-button[color='primary']:not([disabled]) {
  background: $color-primary;
  color: #fff;
}

[mat-flat-button].mat-flat-button[color='warn']:not([disabled]) {
  background: $color-error;
  color: #fff;
  border-color: $color-error;
}

[mat-flat-button].mat-flat-button:hover:not([disabled]) {
  opacity: 0.75;
}

/* 空心按钮样式 */
[mat-stroked-button].mat-stroked-button:not([disabled]) {
  color: rgba(0, 0, 0, 0.65);
  border-color: #d9d9d9;
}

[mat-stroked-button].mat-stroked-button:hover:not([disabled]),
[mat-stroked-button].mat-stroked-button[hover='blue']:hover:not([disabled]) {
  color: $color-primary;
  border-color: $color-primary;
}

[mat-stroked-button].mat-stroked-button[hover='danger']:not([disabled]) {
  &:hover {
    color: $color-error;
    border-color: $color-error;
  }
}

/* 图标按钮样式 */
[mat-icon-button].mat-icon-button {
  width: 32px;
}
